package com.itcast.generictype.Demo05;

/*
要写注释哦!!!
*/
public class Test {
    public static void main(String[] args) {
        String str="1,2.3,40,60";

        double sum=0;
        String[] arr = str.split(",");
        for (int i = 0; i < arr.length; i++) {
            double num = Double.parseDouble(arr[i]);
            sum+=num;
        }
        System.out.println(sum);
    }

}
